<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="./template.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .logo {
                width: 5%
            }
            
            .detail {
                width: 95%;
                padding-left: 25px;
            }
            
            .detail td {
                font-size: 24px;
            }
            
            .ui-datascroller .ui-datascroller-item {
                border-bottom: 1px solid #A8A8A8;
                padding: 25px 10px;
                /* with the exported variables from Nova and Luna Themes*/
                border-bottom-color: var(--input-border-color, #A8A8A8);
            }
        </style>
	</ui:define>
    
    <ui:define name="title">
        DataScroller - <span class="subitem">Loader</span>
    </ui:define>

    <ui:define name="description">
        A custom component can be used instead to load data on demand instead of the scroll event.
    </ui:define>

    <ui:param name="documentationLink" value="/components/datascroller" />

    <ui:define name="implementation">

        <h:form> 
            <p:dataScroller value="#{dataScrollerView.cars}" var="car" chunkSize="10">
                <f:facet name="header">
                    Scroll Down to Load More Cars
                </f:facet>
                
                <f:facet name="loader">
                    <p:commandButton type="button" value="More" icon="pi pi-chevron-circle-down"/>
                </f:facet>

                <h:panelGrid columns="2" style="width:100%" columnClasses="logo,detail">
                    <p:graphicImage name="demo/images/car/#{car.brand}-big.gif" /> 

                    <p:outputPanel>
                        <h:panelGrid columns="2" cellpadding="5">
                            <h:outputText value="Id:" />
                            <h:outputText value="#{car.id}" style="font-weight: bold"/>

                            <h:outputText value="Year:" />
                            <h:outputText value="#{car.year}" style="font-weight: bold"/>

                            <h:outputText value="Color:" />
                            <h:outputText value="#{car.color}" style="font-weight: bold"/>
                        </h:panelGrid>
                    </p:outputPanel>
                </h:panelGrid>
            </p:dataScroller>
        </h:form>
        
    </ui:define>

</ui:composition>